home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / motorola / asref next >
Text File  |  1993-07-18  |  54KB  |  861 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. MOTOROLA
  16. FREEWARE
  17. 8-BIT CROSS ASSEMBLERS
  18. USER'S MANUAL
  19. ARCHIMEDES VERSION
  20.  
  21.  
  22.  
  23. MAURIZIO FERRARI  1993
  24. ORIGINALLY EDITED BY
  25. KEVIN ANDERSON
  26. FIELD APPLICATIONS ENGINEER
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. Support Contact: Maurizio Ferrari, Via Pareto 12, 42020 Albinea (RE), Italy
  48. Contents
  49. CHAPTER 1       1
  50. GENERAL INFORMATION     1
  51. 1.1 INTRODUCTION        1
  52. 1.2 ASSEMBLY LANGUAGE   2
  53. 1.3 OPERATING ENVIRONMENT       2
  54. 1.4 ASSEMBLER PROCESSING        3
  55. 1.5 DISTRIBUTION DISK   3
  56. CHAPTER 2       4
  57. CODING ASSEMBLY LANGUAGE PROGRAMS       4
  58. 2.1 INTRODUCTION        4
  59. 2.2 SOURCE  STATEMENT FORMAT    4
  60. 2.2.1 Label Field       4
  61. 2.2.2 Operation Field   5
  62. 2.2.3 Operand Field     5
  63. 2.2.3.1 M6805/M68HC05 Operand Syntax    5
  64. 2.2.3.2 M68HC11 Operand Syntax  5
  65. 2.2.3.3 Expressions.    6
  66. 2.2.3.4 Operators.      6
  67. 2.2.3.5 Symbols.        6
  68. 2.2.3.6 Constants.      6
  69. 2.2.4 Comment Field     7
  70. 2.3 ASSEMBLER OUTPUT    7
  71. CHAPTER 3       9
  72. RUNNING THE ASSEMBLERS  9
  73. 3.1 ASSEMBLER INSTALLING        9
  74. 3.2 ASSEMBLER INVOCATION        9
  75. 3.3 ERROR MESSAGES      10
  76. CHAPTER 4       11
  77. ASSEMBLER DIRECTIVES    11
  78. 4.1 INTRODUCTION        11
  79. 4.2 BSZ - BLOCK STORAGE OF ZEROS        11
  80. 4.3 EQU - EQUATE SYMBOL TO A VALUE      11
  81. 4.4 FCB - FORM CONSTANT BYTE    12
  82. 4.5 FCC - FORM CONSTANT CHARACTER STRING        12
  83. 4.6 FDB - FORM DOUBLE BYTE CONSTANT     12
  84. 4.7 FILL - FILL MEMORY  12
  85. 4.8 OPT - ASSEMBLER OUTPUT OPTIONS      12
  86. 4.9 ORG - SET PROGRAM COUNTER TO ORIGIN 13
  87. 4.10 PAGE - TOP OF PAGE 13
  88. 4.11 RMB - RESERVE MEMORY BYTES 13
  89. 4.12 ZMB - ZERO MEMORY BYTES  (same as BSZ)     14
  90. 4.13 INCLUDE - INCLUDE FILES    14
  91. 4.14 IFD, IFND, ELSE, ENDIF     14
  92. 4.15 BSS, CODE, DATA, AUTO      14
  93. APPENDIX A      15
  94. CHARACTER SET   15
  95. APPENDIX B      17
  96. ADDRESSING MODES        17
  97. B.1 M6805/68HC05 ADDRESSING MODES.      17
  98. B.2 M68HC11 ADDRESSING MODES.   18
  99. APPENDIX C      20
  100. DIRECTIVE SUMMARY       20
  101. APPENDIX D      21
  102. ASSEMBLER LISTING FORMAT        21
  103. APPENDIX E      22
  104. S-RECORD INFORMATION    22
  105. E.1 INTRODUCTION        22
  106. E.2 S-RECORD CONTENT    22
  107. E.3 S-RECORD TYPES      22
  108. E.4 S-RECORD EXAMPLE    22
  109.  
  110. CHAPTER 1
  111. GENERAL INFORMATION
  112. 1.1 INTRODUCTION
  113. This is the user's reference manual for the Archimedes  hosted  Motorola Freeware  8  bit  cross  
  114. assemblers, ported to the Archimedes to take advantage of the RISC OS facilities, especially throwback 
  115. (routines by Niklas R÷jemo, many thanks for usage permission), drop and drag, and multitasking. It has 
  116. become much more friendly than the original, command line, PC version. The code is based upon the 
  117. Motorola freeware release TER_2.0 v 2.09. It's has been rewritten in ANSI style, and all the UNIX filing 
  118. system calls have been replaced by ANSI ones. It's 99.9 percent compatible with Motorola AS11 source 
  119. formats, the small difference regarding the way it treats the FCC directive (the original was a possible 
  120. source of bugs, and buggy too!) and command line syntax. All the RISC OS interface is handled by the 
  121. appropriate DDEUtils and FrontEnd modules: as they are not freeware, I cannot supply them. They are 
  122. rather common, though, and yes, !asm11 and !asm05 should run from command line too! Up to now, I have 
  123. not had time to study the behaviour of directives at chapters 4.13, 4.14, 4.15.
  124. The only supported mC  are the ubiquitous 68HC11 and 68HC05. 
  125. !asm11/05 is freeware. However, as it took many hours to port it, I request the user to send, in 
  126. exchange, feedback on its use and reports any bugs, so that I may get rid of them, given enough time. You 
  127. are not allowed to make money reselling it as a software product. If you use it professionally and develop 
  128. any systems, I'd love to know it. If you think it's valuable, a donation is welcome (say, 5 or 10 ú) but not 
  129. requested, as this is freeware. 
  130. This manual is in a very preliminary stage. I couldn't cross check it 100% versus the real 
  131. assembler behaviour, but should give you enough info to start working. It comes in three forms: an 
  132. Impression file, a Postscript file (if you don't have Impression but have access to a PS printer) and an ASCII 
  133. (saved from Impression) plain text, for the rest of the world. The more differences you'll report between it 
  134. and !asm11/05, the better it will become. Thanks.
  135. You can redistribute this software, according to the following terms:
  136. a) No charge is taken for such distribution. If you want to include it in a public/share/whatever 
  137. library then you can not charge anything for a disc which contains this software. It is explicitly forbidden to 
  138. use this software as a value added benefit to any other product for which a charge is taken.
  139. b) This program is distributed in its entirety, included copyright messages and these conditions, 
  140. and in original and unaltered copies. This is only because I want to keep track of it and check any 
  141. alterations, and be reasonably sure that nobody blames me for someone else's fault. Also, as I said for the 
  142. manual, bugs will probably be fixed and it's for everybody's good to have it done. 
  143. c)  You don't flame me for coding style: I don't like it either, it's difficult to mantain, it was not 
  144. ANSI, but I'm very grateful to the guy who took the time to write it in the beginning, and to Motorola that 
  145. provided the original source. I do it in my spare time, my goal was to have it running asap, and it's free!
  146. Legally, you are not bound to this agreement, but failing to do so will make your conscience 
  147. haunt you for the rest of your life! 
  148. Neither Motorola, Inc. (obviously, as they don't even know this assembler exist, yet! I will 
  149. upload it to their BBS anyway) nor Maurizio Ferrari makes any warranty, expressed or implied, with regard 
  150. to this material including but not limited to merchantability and fitness for a given purpose. The information 
  151. in this document is subject to change without notice and neither Motorola, Inc. or Maurizio Ferrari assumes 
  152. any responsibility for any errors which may appear herein. Nor shall Motorola, Inc. or Maurizio Ferrari bear 
  153. any liability for use of this material with respect compensatory, special, incidental, consequential, or 
  154. exemplary damages.
  155. This software may contain bugs, and these in turn may cause any disaster you can think of, 
  156. including but not limited to your wife/girlfriend husband/boyfriend /anyone hitting you hard for staying 
  157. awake at night debugging nasty code. You have been warned - I know what it's like. Many thanks to my 
  158. wife Olivia for her patience.
  159. This manual  details  the  features and capabilities  of  the  cross   assemblers,   assembler   
  160. syntax   and directives,  options,  and  listings.  It  is  intended as a detailed reference and an introduction  
  161. for  those  unfamiliar  with  Motorola assembler   syntax  and  format.   Those  experienced  with  Motorola 
  162. assembler  products  may  wish  to  examine  the  file  ASSEMBLER.DOC available  with  the  cross  
  163. assemblers.
  164. Assemblers are programs that process assembly language source program statements and 
  165. translate them into executable machine language object files. A programmer writes his source program 
  166. using any text editor or word processor that can produce an ASCII text output. With  some word  processors  
  167. this is known as "non document" mode.  Non document mode produces a  file  without  the  non-printable  
  168. embedded  control characters that are used in document formatting.  (Caution: assembling a file that has 
  169. been formatted with embedded control  characters  may produce assembler errors.  The solution is to 
  170. convert the source file to ASCII text.) Once the source code is written, the source  file  is assembled by 
  171. processing the file via the assembler.
  172. Cross  assemblers  (such  as  the Motorola Freeware Assemblers) allow source programs written 
  173. and edited on  one  computer  (the  host)  to generate  executable  code  for  another  computer (the target).  
  174. The executable object file can then be downloaded and run on  the  target system.   In  this  case  the host is 
  175. a RISC OS computer and the target system is based on  a  Motorola  8-bit  microprocessor  ( 6805, 68HC05  
  176. or 68HC11).
  177. The  assemblers are the application directories !asm11 or !asm05, depending on which  
  178. microprocessor  you  are writing  code  for.   The details of executing the assembler programs are found in 
  179. Chapter 3.  The assembly language format and syntax  for the  various processors is very similar with slight 
  180. variations due to varied programming resources  (instructions,  addressing  modes,  and registers). These 
  181. variations are explained in Appendix B.
  182. Many thanks to my lovely wife Olivia for not hitting me, thus allowing this program to be 
  183. distributed... 
  184. 1.2 ASSEMBLY LANGUAGE
  185. The symbolic language used to code source programs to be processed by the  Assembler  is  
  186. called  assembly  language.  The  language  is  a collection   of  mnemonic  symbols  representing:  
  187. operations  (i.e., machine  instruction  mnemonics  or  directives  to  the  assembler), symbolic names, 
  188. operators, and special symbols. The assembly language provides mnemonic operation codes for all machine 
  189. instructions in the instruction  set.  The  instructions are defined and explained in the Programming 
  190. Reference Manuals for  the  specific  devices,  available from Motorola. The assembly language also 
  191. contains mnemonic directives which  specify  auxiliary  actions  to be performed by the Assembler. These 
  192. directives are not always translated into machine language.
  193. 1.3 OPERATING ENVIRONMENT
  194. These assemblers will run on  any  RISC OS 2 or  RISC OS 3 Acorn ARM Computers.   The 
  195. assemblers may be run off of a floppy disk drive or they may be copied onto a hard drive for execution.  
  196. DDEUtils, FrontEnd and a ThrowBack compliant editor are required for running it but from command line.
  197. 1.4 ASSEMBLER PROCESSING
  198. The Assembler is a two-pass assembler. During the first pass, the source program is read to 
  199. develop the symbol  table.  During  the second pass, the object file is created (assembled) with reference to 
  200. the table developed in pass one. It is during the  second  pass  that the source program listing is also 
  201. produced.
  202. Each  source statement is processed completely before the next source statement is read. As each  
  203. statement  is  processed,  the  Assembler examines the label, operation code, and operand fields. The 
  204. operation code table is scanned for a match with a known  opcode.   During  the processing  of  a  standard  
  205. operation  code  mnemonic,  the standard machine code is inserted  into  the  object  file.  If  an  Assembler 
  206. directive is being processed, the proper action is taken.
  207. Any  errors  that  are detected by the Assembler are displayed before the actual line containing 
  208. the error is printed. If no source listing is  being  produced,  error  messages are still displayed to indicate 
  209. that the assembly process did not proceed normally.
  210. 1.5 DISTRIBUTION DISK
  211. The disk contains: (the appended / means it's a directory, else it's a DOS '.')
  212. !asm11/
  213. !asm05/
  214. !AsRef
  215. credits
  216. ReadMe
  217. Examples/
  218. MCX15/
  219. as11/
  220. clkdrivr, mcx, system, test, vectors 
  221. as05/
  222. divide
  223. l/ 
  224. m/
  225. x/ 
  226. S19/
  227. mcx_ref
  228. DOS
  229. as11/exe, as5/exe, assemble, asembler/doc, readme/txt
  230.  
  231. CHAPTER 2                    
  232. CODING ASSEMBLY LANGUAGE PROGRAMS
  233. 2.1 INTRODUCTION
  234. Programs written in assembly language consist of a sequence of source statements.  Each  source  
  235. statement  consists of a sequence of ASCII characters ending with a carriage return.  Appendix A contains a 
  236. list of the supported character set.
  237. 2.2 SOURCE  STATEMENT FORMAT
  238. Each  source statement may include up to four fields: a label (or "*" for a comment line), an 
  239. operation (instruction mnemonic or assembler directive), an operand, and a comment.
  240. 2.2.1 Label Field
  241. The  label field occurs as the first field of a source statement. The label field can take one of the 
  242. following forms:
  243. 1. An asterisk  (*)  as  the  first  character  in  the  label  field indicates  that  the  rest  of  the  
  244. source  statement  is a comment. Comments are ignored by the Assembler, and are printed on the  source 
  245. listing only for the programmer's information.
  246. 2.  A  white space  character  (blank  or  tab) as the first character indicates that the label field is 
  247. empty. The line has no label and is not a comment.
  248. 3.  A symbol character as the first character indicates that the line has a label. Symbol characters 
  249. are the upper or lower case letters a- z,  digits  0-9,  and the special characters, period (.), dollar sign ($), and 
  250. underscore (_). Symbols consist of one to 15 characters, the first  of  which  must be alphabetic or the 
  251. special characters period (.) or underscore (_).  All characters are significant and upper  and lower case 
  252. letters are distinct.
  253. A  symbol  may  occur  only once in the label field. If a symbol does occur more than once in a 
  254. label field, then each  reference  to  that symbol will be flagged with an error.
  255. With  the exception of some directives, a label is assigned the value of the program counter of 
  256. the first byte of the instruction  or  data being  assembled. The value assigned to the label is absolute. Labels 
  257. may optionally be ended with a colon (:).  If the colon is used it is not  part  of the label but merely acts to 
  258. set the label off from the rest of the source line.   Thus  the  following  code  fragments  are equivalent:
  259. here:   deca
  260.         bne     here
  261. here    deca
  262.         bne     here
  263. A  label  may  appear  on a line by itself.  The assembler interprets this as set the value of the 
  264. label equal to the current value of  the program counter.
  265. The  symbol  table  has  room  for  at least 2000 symbols of length 8 characters or less.  
  266. Additional characters up to 15  are  permissible at  the  expense of decreasing the maximum number of 
  267. symbols possible in the table.
  268. 2.2.2 Operation Field
  269. The operation field  occurs  after  the  label  field,  and  must  be preceded  by  at  least one white 
  270. space character. The operation field must contain a legal opcode  mnemonic  or  an  assembler  directive.  
  271. Upper  case  characters  in  this  field  are converted to lower case before being checked as a legal 
  272. mnemonic.  Thus  'nop',  'NOP',  and 'NoP'  are recognized as the same mnemonic. Entries in the operation 
  273. field may be one of two types:
  274. Opcode. These correspond directly to the  machine  instructions.  The operation  code  includes  
  275. any  register  name  associated  with  the instruction.  These register names must not  be  separated  from  
  276. the opcode  with  any  white space  characters.   Thus  'clra' means clear accumulator A, but 'clr a' means 
  277. clear memory location identified  by the label 'a'.
  278. Directive.  These  are special operation codes known to the Assembler which control the 
  279. assembly process rather than being translated  into machine instructions.
  280. 2.2.3 Operand Field
  281. The  operand  field's  interpretation is dependent on the contents of the operation field. The 
  282. operand field, if required, must follow  the operation  field,  and  must  be  preceded by at least one white 
  283. space character. The operand field may contain a symbol, an expression,  or a combination of symbols and 
  284. expressions separated by commas.
  285. The  operand  field  of  machine  instructions is used to specify the addressing mode of the 
  286. instruction, as well as  the  operand  of  the instruction.   The  following  tables  summarize  the  operand  
  287. field formats for the various processor families. (NOTE:  in  these  tables parenthesis  "()"  signify  optional 
  288. elements and angle brackets "<>" denote an expression is inserted.  These syntax elements are  present only  
  289. for clarification of the format and are not inserted as part of the actual source program.  All other characters 
  290. are significant  and must be used when required.)
  291. 2.2.3.1 M6805/M68HC05 Operand Syntax
  292. For the M6805/68HC05, the operand formats are
  293. Operand Format                          M6805/68HC05 Addressing Mode
  294. no operand                      accumulator and inherent
  295. <expression>                    direct, extended, or relative
  296. #<expression>                   immediate
  297. <expression>,X                  indexed
  298. <expression>,<expression>               bit set or clear
  299. <expression>,<expression>,<expression>  bit test and branch
  300. Details of the M6805/68HC05 addressing modes may be found in Appendix B.
  301. 2.2.3.2 M68HC11 Operand Syntax
  302. For the M68HC11, the following operand formats exist:
  303. Operand Format                          68HC11 Addressing Mode
  304. no operand                      accumulator and inherent
  305. <expression>                    direct, extended, or relative
  306. #<expression>                   immediate
  307. <expression>,X                  indexed, X relative
  308. <expression>,Y                  indexed, Y relative
  309. <expression>,<expression>               bit set or clear
  310. <expression>,<expression>,<expression>  bit test and branch
  311. Details of the 68HC11 addressing modes may be found in Appendix B.
  312.  
  313. The  bit manipulation instruction operands are separated by spaces in this case since the HC11  
  314. allows  bit  manipulation  instructions  on indexed addresses.  Thus a ',X' or ',Y' may be added to the final 
  315. two formats above to form the indexed effective address calculation.
  316. Details of the M68HC11 addressing modes  may be found in  Appendix  B. The operand fields 
  317. of assembler directives are described in Chapter 4.
  318. 2.2.3.3 Expressions.
  319. An  expression  is  a combination of symbols, constants, algebraic operators, and parentheses.  
  320. The  expression  is used to specify a value which is to be used as an operand.
  321. Expressions  may  consist of symbols, constants, or the character '*' (denoting the current value 
  322. of the program counter)  joined  together by one of the operators: + - * / % & | ^ .
  323. 2.2.3.4 Operators.  
  324. The operators are the same as in c:
  325.         +       add
  326.         -       subtract
  327.         *       multiply
  328.         /       divide
  329.         %       remainder after division
  330.         &       bitwise and
  331.         |       bitwise or
  332.         ^       bitwise exclusive or
  333. Expressions are evaluated left to right and there is no provision for parenthesized expressions.  
  334. Arithmetic is carried out in signed  two's complement integer precision (that's 16 bits on the IBM PC).
  335. 2.2.3.5 Symbols.   
  336. Each  symbol  is associated with a 16-bit integer value which is used in place of  the  symbol  during  the  
  337. expression evaluation.   The  asterisk  (*)  used  in  an expression as a symbol represents the current value of 
  338. the location counter (the first  byte of a multi-byte instruction).
  339. 2.2.3.6 Constants.   
  340. Constants  represent quantities of data that do not vary in value during the execution of a 
  341. program.   Constants  may be  presented  to  the  assembler  in  one  of five formats: decimal, hexadecimal, 
  342. binary, or octal, or ASCII.   The  programmer  indicates the number format to the assembler with the 
  343. following prefixes:
  344.         $       HEX
  345.         %       BINARY
  346.         @       OCTAL
  347.         '       ASCII
  348. Unprefixed  constants  are  interpreted  as  decimal.   The assembler converts all constants to 
  349. binary machine code and  are  displayed  in the assembly listing as hex.
  350. A  decimal constant consists of a string of numeric digits. The value of a decimal constant must 
  351. fall in the range 0-65535, inclusive.  The following example shows both valid and invalid decimal 
  352. constants:
  353.         VALID   INVALID REASON INVALID
  354.         12      123456  more than 5 digits
  355.         12345   12.3    invalid character
  356. A  hexadecimal constant consists of a maximum of four characters from the set of digits (0-9) 
  357. and the upper case alphabetic letters  (A-F), and is preceded by a dollar sign ($).  Hexadecimal constants 
  358. must be in  the  range $0000 to $FFFF. The following example shows both valid and invalid hexadecimal 
  359. constants:
  360.         VALID   INVALID REASON INVALID
  361.         $12     ABCD    no preceding "$"
  362.         $ABCD   $G2A    invalid character
  363.         $001F   $2F018  too many digits
  364. A binary constant consists of a maximum of 16 ones or zeros  preceded by  a  percent  sign (%).  
  365. The following example shows both valid and invalid binary constants:
  366.         VALID   INVALID REASON INVALID
  367.         %00101  1010101 missing percent
  368.         %1      %10011000101010111  too many digits
  369.         %10100  %210101 invalid digit
  370. An octal constant consists  of  a  maximum  of  six  numeric  digits, excluding  the  digits 8 and 
  371. 9, preceded by a commercial at-sign (@). Octal constants must be in the ranges @0 to @177777.   The  
  372. following example shows both valid and invalid octal constants:
  373.         VALID           INVALID REASON INVALID
  374.         @17634          @2317234        too many digits
  375.         @377            @277272         out of range
  376.         @177600         @23914          invalid character
  377. A  single  ASCII  character can be used as a constant in expressions. ASCII constants are 
  378. preceded by a single quote  (').  Any  character, including the single quote, can be used as a character 
  379. constant.  The following example shows both valid and invalid character constants:
  380.         VALID           INVALID         REASON INVALID
  381.         '*               'VALID         too long
  382. For the invalid case above the assembler will not indicate an  error. Rather it will assemble the 
  383. first character and ignore the remainder.
  384. 2.2.4 Comment Field
  385. The last field of an Assembler source statement is the comment field. This field is optional and is 
  386. only printed on the source listing  for documentation  purposes.  The  comment  field  is  separated from the 
  387. operand field (or from the operation field if no operand is required) by  at  least one white space character. 
  388. The comment field can contain any printable ASCII characters.
  389. 2.3 ASSEMBLER OUTPUT
  390. The Assembler output includes  an  optional  listing  of  the  source program  and an object file 
  391. which is in the Motorola S Record format. Details of the S Record format may  be  found  in  Appendix  E.   
  392. The Assembler  will normally suppress the printing of the source listing. This condition, as well as others,  
  393. can  be  overridden  via  options supplied on the command line that invoked the Assembler.
  394. Each  line  of  the  listing  contains  a  reference line number, the address and bytes assembled, 
  395. and the original source input line.   If an  input line causes more than 6 bytes to be output (e.g. a long FCC 
  396. directive), additional bytes (up to  64)  are  listed  on  succeeding lines with no address preceding them.
  397. The assembly listing may optionally contain a symbol table or a cross reference table of all 
  398. symbols appearing in the  program.  These  are always  printed  at  the  end  of  the assembly listing if either 
  399. the symbol table or cross reference table options (Paragraph 4.8) are  in effect. The symbol table contains 
  400. the name of each symbol, along with its defined value. The cross reference  table  additionally  contains the  
  401. assembler-maintained  source  line  number of every reference to every symbol. The format of the cross 
  402. reference  table  is  shown  in Appendix D.
  403.  
  404. CHAPTER 3
  405. RUNNING THE ASSEMBLERS
  406. 3.1 ASSEMBLER INSTALLING
  407. !asm11/05 will require the following directories to be present:
  408. root                    $
  409. level 1...n-1                   ...
  410. level n         <project_name>
  411. level n-1               <source>, <object>, l, m, x     
  412. It will write its temporary file to Wimp$ScrapDir and will complain if it's unset.
  413. The accompanying example (on distribution disk) will clarify this subject.
  414. 3.2 ASSEMBLER INVOCATION
  415. Double Click the !asm11/05 icon or drag it (RO3) to the icon bar. If you must compile several 
  416. files at once, drag the first to the icon bar icon and the others to the pop-up window. The first file will give 
  417. its name to the list, map and xref files, and to the proposed object, though this can be changed by dragging 
  418. from its save window after successful compilation. 
  419. (If you really want to feel the thrill of command line, you can use the asm11 or asm05 
  420. executables , depending on  which  processor  family you  wish  to assemble code for.  To  run the 
  421. assembler enter the following command line:
  422.          as*   file1 (file2 . . . ) ( - option1 option2 . . . )
  423. where file1, file2, etc are the names of the source files you wish to assemble. The source 
  424. filenames may have extensions but the assembler does not check for any particular extensions.)
  425. The options are one or more of the following:
  426.         -o <objname>    S19 file output name 
  427.         -list           enables output listing (default: no listing)
  428.         -x      enables the cross reference table generation
  429.         -sym            enables the symbol table generation
  430.         -cyc            enables cycle counting
  431.         -p <pages>      page every <page> lines
  432.         -crlf   add line feed to S19 file
  433.         -nnf    separately number include files
  434. The object file created is written to disk when dragged from the save box, with the default name  
  435. 'S19.FILENAME' where 'FILENAME' is the name of the first source  file specified  on  the command line.  
  436. Any errors are displayed on the screen and Throwback will point to the corresponding lines in the input 
  437. files.  The optional listing will be saved to a "l.FILENAME' file for later examination. Same for Cross 
  438. reference "x.FILENAME' and symbol table "m.FILENAME' .
  439. Example: The command line
  440.          as11 system mcx clckdrivr vectors -list -x -sym -o test
  441. would run the 68HC11 assembler on  the  source  files  system, mcx, clokdrivr, vectors.  The  
  442. object  file  would be written to 'test'.  A listing would be  created  followed  by  a  symbol  table  and  cross 
  443. reference which would all be written to the files l.system, m.system, x.system. Do not use the same name 
  444. for input and output (-o) file from command line!
  445. The same result would have more easily been obtained dragging 'system' to the !asm11 icon on  
  446. the icon bar, dragging mcx, clokdrivr, vectors to the pop up menu, and clicking the appropriate icons. A file 
  447. 's19.system' is automatically generated and asked for saving at the end of the compilation.
  448. 3.3 ERROR MESSAGES
  449. Error  diagnostic messages are placed in the listing file just before the line containing the error.  
  450. The format of the error line is:
  451.                 Line_number:    Description of error
  452.                                                 or
  453.                 Line_number:    Warning ---- Description of error
  454. Errors in pass one cause cancellation of pass two.   Warning  do  not cause  cancellation  of  pass  
  455. two  but are indications of a possible problem.  Error messages are meant to be self-explanatory.
  456. If more than one file is being assembled, the file name precedes  the error:
  457.                 File_name,Line_number:  Description of error
  458. Some  errors  are classed as fatal and cause an immediate termination of the assembly.  
  459. Generally this happens when a temporary file cannot be created or is lost during assembly.
  460. Throwback will work according to its rules: remember to use a suitable editor!
  461.  
  462. CHAPTER 4
  463. ASSEMBLER DIRECTIVES
  464. 4.1 INTRODUCTION
  465. The  Assembler  directives  are instructions to the Assembler, rather than instructions to be 
  466. directly translated into  object  code.  This chapter  describes the directives that are recognized by the 
  467. Freeware Assemblers. Detailed descriptions  of  each  directive  are  arranged alphabetically. The notations 
  468. used in this chapter are:
  469. ( )  Parentheses denote an optional element.
  470. XYZ  The names of the directives are printed in capital letters.
  471. <  >  The  element names are printed in lower case and contained in angle brackets.  
  472. All elements outside of the angle brackets '<>' must be  specified as-is. For example, the 
  473. syntactical element (<number>,) requires the comma to be specified if the optional  element  <number> is  
  474. selected.  The  following  elements  are  used  in the subsequent descriptions:
  475.         <comment>       A statement's comment field
  476.         <label>                 A statement label
  477.         <expression>    An Assembler expression
  478.         <expr>          An Assembler expression
  479.         <number>        A numeric constant
  480.         <string>        A string of ASCII characters
  481.         <delimiter>     A string delimiter
  482.         <option>        An Assembler option
  483.         <symbol>        An Assembler symbol
  484.         <sym>           An Assembler symbol
  485.         <sect>                  A relocatable program section
  486. In the following descriptions of the various directives, the  syntax, or  format,  of  the directive is 
  487. given first.  This will be followed with the directive's description.
  488. 4.2 BSZ - BLOCK STORAGE OF ZEROS
  489. (<label>)       BSZ     <expression>    (<comment>)
  490. The BSZ directive causes the Assembler to allocate a block of  bytes. Each  byte is assigned the 
  491. initial value of zero. The number of bytes allocated is given by the expression in the  operand  field.  If  the 
  492. expression  contains  symbols  that  are  either undefined or forward referenced (i.e. the definition occurs 
  493. later on in the file),  or  if the expression has a value of zero, an error will be generated.
  494. 4.3 EQU - EQUATE SYMBOL TO A VALUE
  495. <label> EQU     <expression>    (<comment>)
  496. The  EQU directive assigns the value of the expression in the operand field to the label. The 
  497. EQU directive assigns a value other than  the program  counter to the label. The label cannot be redefined 
  498. anywhere else in the program.   The  expression  cannot  contain  any  forward references or undefined 
  499. symbols.  Equates with forward references are flagged with Phasing Errors.
  500. 4.4 FCB - FORM CONSTANT BYTE
  501.         (<label>)       FCB     <expr>(,<expr>,...,<expr>)      (<comment>)
  502. The FCB directive may have one or more operands separated by  commas. The  value  of each 
  503. operand is truncated to eight bits, and is stored in a single byte of the object program.  Multiple operands 
  504. are stored in  successive  bytes.  The  operand  may  be  a  numeric constant, a character constant, a symbol, 
  505. or an expression. If multiple  operands are  present,  one or more of them can be null (two adjacent 
  506. commas), in which case a single  byte  of  zero  will  be  assigned  for  that operand. An error will occur if 
  507. the upper eight bits of the evaluated operands' values are not all ones or all zeros.
  508. 4.5 FCC - FORM CONSTANT CHARACTER STRING
  509.                 (<label>)       FCC     <delimiter><string><delimiter> (<comment>)
  510. The FCC directive has been slightly modified in this Arc porting. Originally, any ASCII 
  511. printable characters could be used as delimiter: the assembler would pick the first non-blank after the FCC 
  512. directive and expect the same character at the end of the string. As this could generate subtle bugs (suppose 
  513. you wanted to write 'donald' and  forgot the ('): the old assembler would assume 'onal' without 
  514. complaining), I have changed it to be either ' or ". the symbol must be the same at the beginning and at the 
  515. end of the string, i.e. you can not write 'qwerty" or "qwerty". A bug that prevented the assembler from 
  516. correctly recognizing the ';' char when enclosed in a FCC string has been fixed. The  byte  storage begins at 
  517. the current program counter.  The label is assigned to the first byte in the string.  Any of  the  printable  
  518. ASCII  characters can be contained in the string.  The string is specified between two identical delimiters 
  519. which can be either ' or " characters. 
  520. Example:
  521.         LABEL1          FCC     'ABC'
  522. assembles ASCII ABC at location LABEL1
  523. 4.6 FDB - FORM DOUBLE BYTE CONSTANT
  524.                 (<label>)       FDB     <expr>(,<expr>,...,<expr>)      (<comment>)
  525. The FDB directive may have one or more operands separated by  commas. The  16-bit  value  
  526. corresponding  to each operand is stored into two consecutive bytes of the object program.  The storage 
  527. begins  at  the current  program  counter.  The label is assigned to the first 16-bit value. Multiple operands 
  528. are stored in successive bytes.  The operand may  be  a  numeric  constant,  a character constant, a symbol, 
  529. or an expression. If multiple operands are present, one or more of them can be null (two adjacent commas), 
  530. in which case two bytes of zeros  will be assigned for that operand.
  531. 4.7 FILL - FILL MEMORY
  532.         (<label>)       FILL    <expression>,<expression>
  533. The  FILL  directive  causes  the  assembler to initialize an area of memory with a constant 
  534. value.  The first expression signifies the one byte  value  to  be  placed  in  the memory and the second 
  535. expression indicates the total number of successive  bytes  to  be  initialized.  The  first  expression must 
  536. evaluate to the range 0-255.  Expressions cannot contain forward references or undefined symbols.
  537. 4.8 OPT - ASSEMBLER OUTPUT OPTIONS
  538. OPT     <option>(,<option>,...,<option>)        (<comment>)
  539. The OPT directive is used to control  the  format  of  the  Assembler output.  The options are 
  540. specified in the operand field, separated by commas. All options have a default condition.  Some  options  
  541. can  be initialized from the command line that invoked the Assembler, however the options contained in the 
  542. source file  take  precedence  over  any entered  on  the  command  line.  In  the following descriptions, the 
  543. parenthetical inserts specify "DEFAULT", if the option is the default condition.  All options must be 
  544. entered in lower case. The syntax of these options is not the same as that entered from command line: as 
  545. OPT is rarely used (I guess), and I don't have much time, I decided to leave it as it was. I have not checked 
  546. it either, so I have no idea if they will clash with the command line options; I don't think so. See Appendix 
  547. C
  548. c  -  Enable  cycle counting in the listing.  The total cycle count for that instruction will appear in 
  549. the listing after  the  assembled bytes and before the source code
  550. contc -  Restart  cycle counting in the listing. 
  551. cre  -  Print  a  cross  reference  table  at the end of the source listing. This option, if used, must 
  552. be  specified  before  the  first symbol  in  the  source  program is encountered.  The cross reference listing 
  553. format may be found in Appendix D.
  554. l - Print the listing from this point on.  A  description  of  the listing format can be found in 
  555. Appendix D.
  556. noc - (DEFAULT) Disable cycle counting in the listing.  If the "c" option was used previously in 
  557. the program,  this  option  will  cause cycle counting to cease until the next "OPT c" statement.
  558. nol  -  (DEFAULT)  Do not print the listing from this point on.  An "OPT l" can re-enable listing 
  559. at a later point in the program.
  560. s - Print symbol table at end of source listing.  The symbol table format can be found in 
  561. Appendix D.
  562. crlf -Add <CR> <LF> to S record
  563. p50 - This may produce strange behaviour if used other than from command line, where it has a 
  564. different syntax too. Avoid it.
  565. nnf - Separately number INCLUDE files. As including is buggy, why using it, anyway?
  566. 4.9 ORG - SET PROGRAM COUNTER TO ORIGIN
  567.         ORG     <expression>    (<comment>)
  568. The  ORG directive changes the program counter to the value specified by the expression in the 
  569. operand field. Subsequent statements are assembled into memory locations starting with the new program 
  570. counter value.  If  no  ORG directive is encountered in a source program, the program counter is initialized 
  571. to zero.  Expressions  cannot  contain forward references or undefined symbols.
  572. 4.10 PAGE - TOP OF PAGE
  573.         PAGE
  574. The  PAGE  directive causes the Assembler to advance the paper to the top of the next page. If 
  575. no source listing  is  being  produced,  the PAGE  directive  will have no effect. The directive is not printed 
  576. on the source listing.
  577. 4.11 RMB - RESERVE MEMORY BYTES
  578.         (<label>)       RMB     <expression>    (<comment>)
  579. The RMB directive causes the location counter to be advanced  by  the value of the expression in 
  580. the operand field. This directive reserves a block of memory the length of which in bytes is equal to the  
  581. value of the expression. The block of memory reserved is not initialized to any given value. The expression 
  582. cannot contain any forward references or  undefined  symbols.  This directive is commonly used to reserve 
  583. a scratchpad or table area for later use.
  584. 4.12 ZMB - ZERO MEMORY BYTES  (same as BSZ)
  585.         (<label>)       ZMB     <expression>    (<comment>)
  586. The ZMB directive causes the Assembler to allocate a block of  bytes. Each  byte is assigned the 
  587. initial value of zero. The number of bytes allocated is given by the expression in the  operand  field.  If  the 
  588. expression  contains  symbols  that  are  either undefined or forward references, or if the expression has a 
  589. value of zero, an  error  will be generated.
  590. 4.13 INCLUDE - INCLUDE FILES 
  591. (<label>)       INCLUDE         "<filename>"    (<comment>)
  592. Warning! This directive is buggy. Some day I'll fix it. In the meanwhile, I recommend that you 
  593. don't use it!
  594. It instructs the assembler to include the specified file. However, at the present, it will discard the 
  595. file containing the INCLUDE directive...
  596. 4.14 IFD, IFND, ELSE, ENDIF
  597. The original code implements conditional compilation. This is all I know: I have not been able to 
  598. use, check, or debug this feature.  
  599. 4.15 BSS, CODE, DATA, AUTO
  600. Block Storage Segment (RAM), Code Segment, Data Segment, Data Segment: still unknown! 
  601.  
  602. APPENDIX A
  603. CHARACTER SET
  604. The  character  set recognized by the Freeware Assemblers is a subset of ASCII. The ASCII code  is  shown  
  605. in  the  following  figure.  The following characters are recognized by the Assembler:
  606.         1. The upper case letters A through Z and lower case letters a through z.
  607.         2. The digits 0 through 9.
  608.         3. Five arithmetic operators:   +, -, *, / and %   (remainder after division).
  609.         4. Three logical operators:  &, |, and ^.
  610.         5. The special symbol characters:  underscore (_), period (.), and dollar sign ($).  Only the 
  611. underscore and period may be used as the first character of a symbol.
  612.         6. The characters used as prefixes for constants and addressing modes:
  613.                 #    Immediate addressing
  614.                 $    Hexadecimal constant
  615.                 &    Decimal constant
  616.                 @    Octal constant
  617.                 %    Binary constant
  618.                 '    ASCII character constant
  619.                 7. The characters used as suffixes for constants and addressing modes:
  620.                         ,X   Indexed addressing
  621.                         ,Y   M68HC11 indexed addressing
  622.                 8. Three separator characters:  space, carriage return, and comma.
  623.                 9. The character "*" to indicate comments. Comments may contain any printable characters 
  624. from the ASCII set.
  625.        10. The special symbol backslash "\" to indicate line continuation. When  the  assembler  encounters  
  626. the line continuation character it fetches the next line  and  adds it  to  the end of the first line.  This 
  627. continues until a line is seen which doesn't end with a backslash  or  until the   system   maximum  buffer  
  628. size  has  been  collected (typically greater or equal to 256).
  629.        
  630.  
  631.                         ASCII CHARACTER CODES
  632.            BITS 4 to 6 -- 0    1    2    3    4    5    6    7
  633.            -----------    ------------------------------------- 
  634.                      0    NUL  DLE  SP   0    @    P    `    p
  635.                 B    1    SOH  DC1  :    1    A    Q    a    q
  636.                 I    2    STX  DC2  !    2    B    R    b    r
  637.                 T    3    ETX  DC3  #    3    C    S    c    s
  638.                 S    4    EOT  DC4  $    4    D    T    d    t
  639.                      5    ENQ  NAK  %    5    E    U    e    u
  640.                 0    6    ACK  SYN  &    6    F    V    f    v
  641.                      7    BEL  ETB  '    7    G    W    g    w
  642.                 T    8    BS   CAN  (    8    H    X    h    x
  643.                 O    9    HT   EM   )    9    I    Y    i    y
  644.                      A    LF   SUB  *    :    J    Z    j    z
  645.                 3    B    VT   ESC  +    ;    K    [    k    {
  646.                      C    ff   FS   ,    <    L    \    l    ;
  647.                      D    CR   GS   -    =    M    ]    m    }
  648.                      E    SO   RS   .    >    N    ^    n    ~
  649.                      F    S1   US   /    ?    O    _    o    DEL
  650.  
  651.  
  652. APPENDIX B
  653. ADDRESSING MODES
  654. B.1 M6805/68HC05 ADDRESSING MODES.
  655. INHERENT OR ACCUMULATOR ADDRESSING
  656. The M6805 includes some instructions which require no operands. These instructions  are  self-
  657. contained, and employ the inherent addressing or the accumulator addressing mode.
  658. IMMEDIATE ADDRESSING
  659. Immediate addressing refers to the use of  one  byte  of  information that  immediately  follows  
  660. the  operation  code in memory. Immediate addressing is indicated by preceding the operand field with the 
  661. pound sign  or  number  sign  character (#). The expression following the # will be assigned one byte of 
  662. storage.
  663. RELATIVE ADDRESSING
  664. Relative addressing is used by branch instructions. Branches can only be executed within the 
  665. range -126 to +129 bytes relative to the first byte of  the  branch  instruction.  For  this  mode,  the  
  666. programmer specifies  the branch address expression and places it in the operand field. The actual branch 
  667. offset is calculated by  the  assembler  and put  into  the  second byte of the branch instruction.  The offset is 
  668. the two's complement of the difference between the  location  of  the byte immediately following the branch 
  669. instruction and the location of the destination of the branch.  Branches out of bounds are flagged as errors 
  670. by the assembler.
  671. INDEXED ADDRESSING
  672. Indexed  addressing is relative to the index register. The address is calculated at the time of 
  673. instruction execution by adding a  one-  or two-byte  displacement to the current contents of the X register. 
  674. The displacement immediately follows the operation code  in  memory.   If the  displacement  is zero, no 
  675. offset is added to the index register.  In this case, only the operation code resides in  memory.   Since  no 
  676. sign  extension  is  performed on a one-byte displacement, the offset cannot be negative. Indexed addressing 
  677. is indicated by the characters ",X" following the expression in the operand field.  The special case of ",X", 
  678. without a preceding expression, is treated  as  "0,X".  Some instructions do not allow a two-byte 
  679. displacement.
  680. DIRECT AND EXTENDED ADDRESSING
  681. Direct and extended addressing utilize one (direct) or two (extended) bytes to contain the address 
  682. of the  operand.  Direct  addressing  is limited  to  the  first  256  bytes  of  memory.  Direct and extended 
  683. addressing are indicated by only having an expression in the  operand field.  Some  instructions  do not 
  684. allow extended addressing.  Direct addressing will be used by the Macro Assembler whenever possible.
  685. BIT SET OR CLEAR
  686. The addressing mode used for this  type  of  instruction  is  direct, although the format of the 
  687. operand field is different from the direct addressing mode described above. The operand takes the form 
  688. <expression 1>, <expression 2>. <expression 1> indicates which bit is to be set or cleared.  It must be an 
  689. absolute expression in the range 0-7. It is used in generating the operation code.  <expression 2>  is handled  
  690. as  a  direct  address,  as  described above.  Since the bit manipulation address is direct, only the first 256 
  691. locations  may  be operated on by bit manipulation operations.
  692. BIT TEST AND BRANCH
  693. This  combines  two addressing modes: direct and relative. The format of the operand is: 
  694. <expression 1>, <expression  2>,  <expression  3>. <expression  1>  and <expression 2> are handled in the 
  695. same manner as described above in "bit set or clear".  <expression  3>  is  used  to generate   a  relative  
  696. address,  as  described  above  in  "relative addressing".
  697. B.2 M68HC11 ADDRESSING MODES.
  698. PREBYTE
  699. The number of combinations of instructions and addressing  modes  for the  68HC11  is  larger  
  700. than that possible to be encoded in an 8-bit word (256 combinations).  To expand the opcode map,  certain  
  701. opcodes ($18,  $1A, and $CD) cause the processor to fetch the next address to find the actual instruction.  
  702. These opcodes are known as prebytes and are  inserted  automatically  by the assembler for those 
  703. instructions that require it.l  In  general  the  instructions  contained  in  the alternate maps are those 
  704. involving the Y register or addressing modes that involve the Y index register.   Thus  the  programmer  
  705. make  the trade-off  between  the convenience of using the second index register and the additional time and 
  706. code space used by the prebyte.
  707. INHERENT OR ACCUMULATOR ADDRESSING
  708. The M68HC11 includes some instructions  which  require  no  operands. These  instructions  are  
  709. self-contained,  and  employ  the  inherent addressing or the accumulator addressing mode.
  710. IMMEDIATE ADDRESSING
  711. Immediate addressing refers to the  use  of  one  or  more  bytes  of information  that  
  712. immediately  follow  the operation code in memory. Immediate addressing is indicated by preceding the 
  713. operand field with the pound sign or number sign character (#). The expression following the # will be 
  714. assigned one byte of storage.
  715. RELATIVE ADDRESSING
  716. Relative addressing is used by branch instructions. Branches can only be executed within the 
  717. range -126 to +129 bytes relative to the first byte of  the  branch  instruction.  For  this  mode,  the  
  718. programmer specifies  the branch address expression and places it in the operand field. The actual branch 
  719. offset is calculated by  the  assembler  and put  into  the  second byte of the branch instruction.  The offset is 
  720. the two's complement of the difference between the  location  of  the byte immediately following the branch 
  721. instruction and the location of the destination of the branch.  Branches out of bounds are flagged as errors 
  722. by the assembler.
  723. INDEXED ADDRESSING
  724. Indexed  addressing  is  relative  one of the index registers X or Y.  The address is calculated at 
  725. the time  of  instruction  execution  by adding  a  one-byte  displacement  to  the  current contents of the X 
  726. register. The displacement immediately follows the operation code  in memory.   If  the  displacement  is  
  727. zero,  zero  resides in the byte following the opcode. Since no  sign  extension  is  performed  on  a one-byte  
  728.  displacement,  the  offset  cannot  be  negative.  Indexed addressing  is  indicated  by  the  characters  ",X"  
  729. following   the expression in the operand field.  The special case of ",X", without a preceding expression, is 
  730. treated as "0,X".
  731. DIRECT AND EXTENDED ADDRESSING
  732. Direct and extended addressing utilize one (direct) or two (extended) bytes  to  contain  the  
  733. address of the operand. Direct addressing is limited to the first  256  bytes  of  memory.   Direct  and  
  734. extended addressing  are indicated by only having an expression in the operand field.  Direct addressing will 
  735. be  used  by  the  Assembler  whenever possible.
  736. BIT(S) SET OR CLEAR
  737. The  addressing  mode  used  for  this type of instruction is direct, although the format of the 
  738. operand field is different from the direct addressing   mode   described  above.  The  operand  takes  the  
  739. form <expression 1> <expression 2> where the two expressions are separated by  a blank.  <expression 1> 
  740. signifies the operand address and may be either a direct or an indexed address.   When  the  address  mode  
  741. is indexed, <expression 1> is followed by ',R' where R is either X or Y. This allows bit  manipulation  
  742. instructions  to  operate  across  the complete  64K  address  map.   <expression  2> is the mask byte.  The 
  743. bit(s)  to  be  set  or  cleared  are  indicated  by  ones   in   the corresponding location(s) in the mask byte.  
  744. The mask byte must be an expression in the range 0-255 and is encoded by the programmer.
  745. BIT TEST AND BRANCH
  746. This combines two addressing modes: direct or indexed  and  relative. The   format  of  the  
  747. operand  is:  <expression  1>  <expression  2> <expression  3>  where  the  expressions  are  separated  by  
  748. blanks. <expression 1> identifies the operand an may indicate either a direct or indexed  address.   Indexed  
  749. addresses  are  signified  with  ',R' following  the expression where R is either X or Y. <expression 2> is the 
  750. mask byte.  The bit(s) to be set or cleared are indicated by ones in  the  corresponding  location(s)  in the 
  751. mask byte.  The mask byte must be an expression in the  range  0-255  and  is  encoded  by  the 
  752. programmer. <expression 3> is used to generate a relative address, as described above in "relative 
  753. addressing".
  754.  
  755. APPENDIX C
  756. DIRECTIVE SUMMARY
  757. A complete description of all directives appears in Chapter 4.
  758. ASSEMBLY CONTROL
  759.      ORG  Origin program counter
  760. SYMBOL DEFINITION
  761.      EQU  Assign permanent value
  762. DATA DEFINITION/STORAGE ALLOCATION
  763.      BSZ  Block storage of zero; single bytes
  764.      FCB  Form constant byte
  765.      FCC  Form constant character string
  766.      FDB  Form constant double byte
  767.      FILL Initialize a block of memory to a constant
  768.      RMB  Reserve memory; single bytes
  769.      ZMB  Zero Memory Bytes; same and BSZ
  770.  LISTING CONTROL
  771.      OPT c      Enable cycle counting
  772.      OPT noc    Disable cycle counting
  773.      OPT contc  Re-enable cycle counting
  774.      OPT cre    Print cross reference table
  775.      OPT l      Print source listing from this point
  776.      OPT nol    Inhibit printing of source listing from this point
  777.      OPT s      Print symbol table
  778.      OPT crlf   Add <CR><LF> to S record
  779.      OPT p50    Turn on page flag
  780.      PAGE       Print subsequent statements on top of next page
  781.  
  782.  
  783. APPENDIX D
  784. ASSEMBLER LISTING FORMAT
  785. The Assembler listing has the following format:
  786. LINE#   ADDR  OBJECT CODE BYTES       [ # CYCLES]  SOURCE LINE
  787. The LINE# is a 4 digit decimal number printed as a  reference.   This reference number is used in 
  788. the cross reference.  The ADDR is the hex value of the address for the first byte of the object code  for  this 
  789. instruction.   The OBJECT CODE BYTES are the assembled object code of the source line in hex.  If an 
  790. source line causes more than  6  bytes to be output (e.g. a long FCC directive), additional bytes (up to 64) 
  791. are listed on succeeding lines with no address preceding them.
  792. The # CYCLES will only appear in the listing if the "c" option is  in effect.   It  is enclosed in 
  793. brackets which helps distinguish it from the source listing.  The SOURCE LINE is reprinted  exactly  from  
  794. the source program, including labels.
  795. The symbol table has the following format:
  796. SYMBOL    ADDR
  797. The  symbol  is  taken  directly  from  the label field in the source program.  The  ADDR  is  the  
  798. hexadecimal  address  of  the  location referenced by the symbol.
  799. The cross reference listing has the following format:
  800. SYMBOL   ADDR   *LOC1 LOC2 LOC3 ...
  801. The  SYMBOL and ADDR are the same as above. The * indicates the start of the line reference 
  802. numbers.  The LOCs are the decimal line numbers of the assembler listing where the label occurs.
  803. APPENDIX E
  804. S-RECORD INFORMATION
  805. E.1 INTRODUCTION
  806. The  S-record  output  format encodes program and data object modules into a printable (ASCII) 
  807. format.  This allows viewing of  the  object file  with  standard  tools  and  allows  display of the module 
  808. while transferring from one computer to the next or during loads between  a host  and  target.  The S-record 
  809. format also includes information for use in error checking to insure the integrity of data transfers.
  810. E.2 S-RECORD CONTENT
  811. S-Records are character strings made of several fields which identify the  record  type,  record  
  812. length,  memory  address,  code/data, and checksum.  Each byte of binary  data  is  encoded  as  a  2-
  813. character hexadecimal number: the first character representing the high-order 4 bits, and the second the low-
  814. order 4 bits of the byte.
  815. The 5 fields which comprise an S-record are:
  816. TYPE    RECORD  LENGTH          ADDRESS CODE/DATA       CHECKSUM
  817. The fields are defined as follows:
  818. FIELD   CHARACTERS CONTENTS
  819. Type            2       S-record type - S1, S9, etc.
  820. Record length  2        The count of the character pairs in the record,  excluding  the type and record 
  821. length.
  822. Address 4, 6, 8 The 2-,  3-, or 4-byte address at which the  data  field  is  to be loaded into 
  823. memory.
  824. Code/data       0-2n    From  0  to n bytes of executable code, memory  loadable  data,  or descriptive 
  825. information.
  826. Checksum        2       The least significant byte of the one's complement  of the  sum  of  the values 
  827. represented by the pairs of  characters making up the  record length,  address, and the code/data fields.
  828. Each record may be terminated with a CR/LF/NULL.
  829. E.3 S-RECORD TYPES
  830. Eight types of s-records have been defined to accommodate various encoding,  transportation,  
  831. and   decoding   needs.    The   Freeware assemblers use only two types, the S1 and S9:
  832. S1   A record containing code/data and the 2-byte address at which the code/data is to reside.
  833. S9   A termination record for a block of S1 records. The address field  may  optionally  contain  
  834. the  2-byte address of the instruction to  which control  is to  be  passed.   If  not specified,  the first entry 
  835. point specification encountered in  the  object  module  input  will  be used.  There is no code/data field.
  836. E.4 S-RECORD EXAMPLE
  837. The following is a typical S-record module:
  838.           S1130000285F245F2212226A000424290008237C2A
  839.           S11300100002000800082629001853812341001813
  840.           S113002041E900084E42234300182342000824A952
  841.           S107003000144ED492
  842.           S9030000FC
  843. The module consists of four code/data records and an S9 termination record.
  844. The first S1 code/data record is explained as follows:
  845. S1      S-record type S1, indicating a code/data record to be loaded/verified at a 2-byte address.
  846. 13      Hex 13 (decimal 19), indicating 19 character pairs, representing 19 bytes of  binary data, 
  847. follow.
  848. 00      Four-character  2-byte  address  field:   hex address  0000, indicates location where the 
  849. following data is to be loaded.
  850. The next  16 character pairs are the  ASCII  bytes of the actual program code/data
  851. 2A      Checksum of the first S1 record.
  852. The  second  and  third  S1  code/data  records each also contain $13 character  pairs  and  are  ended  with  
  853. checksums.   The  fourth  S1 code/data record contains 7 character pairs.
  854. The S9 termination record is explained as follows:
  855. S9      S-record type S9, indicating a termination record.
  856. 03      Hex 03, indicating three character pairs (3 bytes) to follow.
  857. 00      Four character 2-byte address field, zeroes.
  858. 00
  859. FC      Checksum of  S9 record.
  860.  
  861.